package com.example.xuecheng.systemservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.xuecheng.systemservice.mapper.DictionaryMapper;
import com.example.xuecheng.systemservice.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.util.pattern.PathPattern;
import po.Dictionary;

import java.util.List;
@Service
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary>  implements DictionaryService
{
    @Autowired
    private  DictionaryMapper dictionaryMapper;
    @Override
    public List<Dictionary> queryAll() {
        List<Dictionary> dictionaries = dictionaryMapper.selectList(null);
        return dictionaries;

    }

    @Override
    public Dictionary getByCode(String code) {
        LambdaQueryWrapper<Dictionary> dictionaryLambdaQueryWrapper = new LambdaQueryWrapper<>();
        dictionaryLambdaQueryWrapper.eq(Dictionary::getCode,code);
        Dictionary dictionary = this.getOne(dictionaryLambdaQueryWrapper);
        return dictionary;
    }
}
